/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DataTypes;

import java.util.ArrayList;

/**
 *
 * @author thang
 */
public class AutoDiaryDataTypes {

    // for placeLog - not used
    public static class KnownPlace_notUsed{
        private String  device_id    = "";
        private int  type_id         = 0;
        private int     time         = 0;
        
        public void setDeviceId(String id){         device_id = id;        }
        public void setTypeId(int ti){         this.type_id = ti;        }
        public void setTime(int time){         this.time = time;        }
        
        public String getDeviceId(){ return device_id; }        
        public int getTypeId(){ return type_id; }        
        public int getTime(){ return time; }        
    }
    
    // for database -----------------------------------
    // for doing with d_actLog table
    public static class ActLog{
        public long id;
        public String device_id;
        public String code;
        public long time1;
        public long time2;
        public double certainty;
    }

    // for doing with d_clearActLog table
    public static class ClearActLog{
        public long id;
        public String device_id;
        public String code;
        public int time1_int;
        public int time2_int;
    }
    
    // for doing with d_placeLog table
    public static class PlaceLog{
        public long id;
        public String device_id;
        public int type_id;
        public int time1_int;
        public int time2_int;
    }
    
    // end for database -----------------------------------
    
    // for using weak constraints -----------------------
    public static class RelationGroup{
        public String relation = "";
        // activities in this group have a relation ex. elimination
        public ArrayList<AmbiLiteral> group;
        
    }
    
    public static class WeightMatrix{
        public String device_id = "";
        public long  time = 0;
        public int windowWeight = 0;
        public ArrayList<AmbiLiteral> matrix;
    }
    
    public static class AmbiLiteral{
        public String  code   = "";
        public int     weight = 0;
        public double  memberValue = 0;
    }
    
    public static class AmbiAct extends Activity{

        // where the event happen
        private int  weight = 0;
        private int  level = 0;
        private int  window_index = 0;
        
        public int getWeight(){ return weight; }
        public int getLevel(){ return level; }
        public int getWindowIndex(){ return window_index; }
        
        public void setWeight( int w) { this.weight = w; }
        public void setLevel( int l) { this.level = l; }
        public void setWindowIndex( int i) { this.window_index = i; }
       
    }
    // end for using weak constraints -----------------------
    
    public static class Activity extends PrimaryActivity{

        // where the event happen
        private double  gpsId = 0;
        private double  placeId = 0;
        
        public double getGpsId(){ return gpsId; }
        public double getPlaceId(){ return placeId; }
        
        public void setGpsId( double id) { this.gpsId = id; }
        public void setPlaceId( double id) { this.placeId = id; }
       
    }
    
    public static class Accelerometer {
        // accelerometer data
        private float 	acceX			= 0;
        private float 	acceY			= 0;
        private float 	acceZ			= 0;
        private long 	sensorTimeStamp	= 0;
        private long 	cpuTimeStamp	= 0;

        // set functions
        public void setAcceX(float x){ this.acceX = x; }
        public void setAcceY(float y){ this.acceY = y; }
        public void setAcceZ(float z){ this.acceZ = z; }
        public void setSensorTimeStamp(long t){ this.sensorTimeStamp = t; }
        public void setCpuTimeStamp(long t){ this.cpuTimeStamp = t; }


        // get functions
        public float getAcceX(){ return this.acceX; }
        public float getAcceY(){ return this.acceY; }
        public float getAcceZ(){ return this.acceZ; }
        public long getSensorTimeStamp(){ return this.sensorTimeStamp; }
        public long getCpuTimeStamp(){ return this.cpuTimeStamp; }
    }
    
    public static class Gps {
        // gps data
        private double 	gpsLat 			= 0;
        private double 	gpsLong 		= 0;
        private float 	gpsAccuracy             = 0;
        private float 	gpsSpeed 		= 0;
        private long 	gpsTime 		= 0;
        private String  device_id       = autodiaryserver.Declare.DEVICE_ID;
        
        // set functions    
        public void setGpsLat(double l) 	{ this.gpsLat = l; }
        public void setGpsLong(double l) 	{ this.gpsLong = l; }
        public void setGpsAccuracy(float a) { this.gpsAccuracy = a; }
        public void setGpsSpeed(float s)	{ this.gpsSpeed = s; }
        public void setGpsTime(long t)		{ this.gpsTime = t; }
        public void setDevice_id( String id ) { this.device_id = id; }        

        // get functions    
        public double getGpsLat()		{ return this.gpsLat; }
        public double getGpsLong()		{ return this.gpsLong; }
        public float getGpsAccuracy()	{ return this.gpsAccuracy; }
        public float getGpsSpeed()		{ return this.gpsSpeed; }
        public long getGpsTime()		{ return this.gpsTime; }
        public String getDevice_id() { return this.device_id; }        
    }

    public static class ComplexActivity extends PrimaryActivity{
    }
    
    public static class PrimaryActivity {
        // primitive activity
        private String 	code 		= "";
        private long 	sensorTimeStamp = 0;    // note: actual data is system time
        private String  device_id       = autodiaryserver.Declare.DEVICE_ID;

        // set functions    
        public void setActivityCode(String code) { 
            if (code != null) {
                    this.code = code.trim(); 
            }
        }
        public void setSensorTimeStamp(long time){	this.sensorTimeStamp = time; }
        public void setDevice_id( String id ) { this.device_id = id; }

        // get functions    
        public String getActivityCode() { return this.code; }
        public long getSensorTimeStamp() { return this.sensorTimeStamp; }
        public String getDevice_id() { return this.device_id; }

    }
    
    public static class Place {

        private long    id          = 0;
        private String  name        = "";
        private int     distance    = 0;        // to user position by gpsData
        private long    gpsData_id  = 0;
        private double  latitude    = 0;
        private double  longitude   = 0;
        
        public long getId(){ return this.id; }
        public String getName(){ return this.name; }
        public int getDistance(){ return this.distance; }
        public long getGpsDataId(){ return this.gpsData_id; }
        public double getLatitude(){ return this.latitude; }
        public double getLongitude(){ return this.longitude; }
        
        public void setId(long i){ this.id = i; }
        public void setName(String n){ this.name = n; }
        public void setDistance(int d){ this.distance = d; }
        public void setGpsDataId(long i){ this.gpsData_id = i; }
        public void setLatitude(double l){ this.latitude = l; }
        public void setLongitude(double l){ this.longitude = l; }
       
    }
    
    public static class Type{
        private int id      = 0;
        private String type = "";
        
        public int getId(){ return this.id; }
        public String getType(){ return this.type; }
        
        public void setId(int i) { this.id = i;  }
        public void setType(String t) { this.type = t;  }
    }

}
